package com.yanqu.road.server.manger.giftKey;


import com.yanqu.road.logic.thread.ThreadTaskManger;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.concurrent.atomic.AtomicInteger;


//盐场争霸活动
public class GiftKeyMgr extends TempMgr {


    private static Logger logger = LogManager.getLogger(GiftKeyMgr.class.getName());

    private static ThreadTaskManger threadTaskManger;

    private static AtomicInteger actionId = new AtomicInteger(1);


    //把所有请求任务添加进去
    public static void addTask(GeneralTask task) {
        threadTaskManger.addTask(actionId.getAndIncrement(), task);
    }

    @Override
    public boolean stop() {
        return false;
    }

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    @Override
    public boolean reloadConfig() throws Exception {
        return true;
    }

    @Override
    public boolean save() {
        return true;
    }

    @Override
    public boolean reloadData() {
        threadTaskManger = new ThreadTaskManger(4, "giftKeyTaskManger");
        return true;
    }
}
